<?php
/**
 * Created by PhpStorm.
 * User: lcz
 * Date: 2018/6/26
 * Time: 9:26
 * 售后相关表
 */
namespace app\mobile\controller;

use app\common\controller\Mobile;

class Aftersales extends Mobile {

	/**
	 * 选择售后类型
	 */
	public function selectType(){
		return $this->fetch('selectType', [
			'title' => '售后类型',
			'datas' => json_encode(input()),
		]);
	}
	
	
	/***
	 * 申请售后
	 */
	public function apply(){
		$model = new \app\common\model\AfterSales();
		$types = [
			$model::TYPE_ONLY_MONEY => '申请退款',
			$model::TYPE_MONEY_PRODICT => '申请退货退款',
			$model::TYPE_EXCHANGE => '申请换货'
		];
		return $this->fetch('apply', [
			'title' => $types[input('after_type')],
			'datas' => json_encode(input()),
		]);
	}
	
	
	/**
	 * 售后申请记录
	 */
	public function index(){
		return $this->fetch('index', [
			'title' => '售后申请记录',
		]);
	}
	
	/**
	 * 售后申请详情
	 */
	public function detail(){
		return $this->fetch('detail', [
			'title' => '售后申请详情',
			'datas' => json_encode(input()),
		]);
	}
}